<template>
  <div class="map-exchange-bg">
    <SingleTaskUpload v-if="mapState == '1'" @changeTab="changeTabFn"></SingleTaskUpload>
    <SingleTaskRange v-if="mapState == '2'" :expandMapData="expandMapData" @changeTab="changeTabFn"></SingleTaskRange>
    <SingleTaskConf v-if="mapState == '3'" :expandMapData="expandMapData" :obj="singleObj" @changeTab="changeTabFn"></SingleTaskConf>
  </div>
</template>

<script>
import SingleTaskUpload from "./singleTaskUpload.vue";
import SingleTaskRange from "./singleTaskRange.vue";
import SingleTaskConf from "./singleTaskConf.vue";

export default {
  name: 'MapExchange',
  components: {
    SingleTaskUpload,
    SingleTaskRange,
    SingleTaskConf
  },
  data() {
    return {
      mapState: '1',
      expandMapData: null,
      singleObj: null,
    }
  },
  mounted() {},
  methods: {
    chooseState(idx) {
      this.mapState = idx;
    },
    changeTabFn(idx, data, singleObj) {
      this.mapState = idx;
      if (idx == '2' || idx == '3') this.expandMapData = data;
      if (idx == '3') this.singleObj = singleObj;
    }
  },
}
</script>

<style lang="scss" scoped>
</style>
